package com.mall.service.impl;

import com.mall.dao.IOrderDao;
import com.mall.domain.OrderCopy;
import com.mall.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service("orderService")
public class OrderServiceImpl implements IOrderService {

	@Autowired
	private IOrderDao orderDao;

	//查看全部订单
	@Override
	public List<OrderCopy> findAllOrder() {
		return orderDao.findAllOrder();
	}

	@Override
	public List<OrderCopy> findAllOrderByType(Integer type) {
		return orderDao.findAllOrderByType(type);
	}

	@Override
	public List<OrderCopy> findOrderById(String order_code) {
		return orderDao.findOrderById(order_code);
	}

	@Override
	public Integer deleteOrder(String order_code) {
		return orderDao.deleteOrder(order_code);
	}

	@Override
	public Integer payOrder(Date payment_time, String order_code) {

		return orderDao.payOrder(payment_time,order_code);
	}

	@Override
	public Integer endOrder(Date end_time, String order_code) {
		return orderDao.endOrder(end_time,order_code);
	}

	@Override
	public List<OrderCopy> findAllOrderDetails(){
		return orderDao.findAllOrderDetails();
	}
}
